Path Class Reference

#include <Path.h>

Inheritance diagram for Path:

TraffEduObject List of all members.

Public Member Functions

 Path ()
 Path (string pathname, float scale)
void draw (osg::ref_ptr< osg::Group > root, int animationFlag=-1)
void deletePart ()
osg::Vec3 calculateCatmull (osg::Vec3 first, osg::Vec3 second, osg::Vec3 third, osg::Vec3 fourth, double fifth)
void setPoints (double number=1.0)
osg::Node * displayLines (void)
osg::Node * displayDots (void)
void addNewPoint (osg::Vec3 first, double number=1.0)
osg::Vec3 * getControlPointVector ()
osg::Vec3 * getPointVector ()
double * getRotationArray ()
void setRotationArray ()
double returnAngle (osg::Vec3d first, osg::Vec3d second)

Private Attributes

osg::Vec3 controlPointArray [MAXCONTROLPOINTS]
osg::Vec3 pointArray [MAXPOINTS]
double rotationArray [MAXPOINTS]
int numControlPoints
int numPoints
int controlPointsIndex
int rotationArrayIndex
osg::Geode * lineGeode
osg::Geometry * lineGeom
osg::Geode * dotGeode
osg::Geometry * dotGeom
osg::Group * lineGroup
osg::Group * dotGroup

Detailed Description

A class to implement one type of TraffEduObject, that is Path.


Constructor & Destructor Documentation

Path::Path (   ) 
 

A constructor. default constructor.

Path::Path (  string  pathname,
float  scale
) 
 

A constructor.

Parameters:
pathname string argument defining path name.
scale is a float argument defining scale factor.


Member Function Documentation

void Path::addNewPoint (  osg::Vec3  first,
double  number = 1.0
) 
 

a normal member taking two arguments .

Parameters:
first one is osg::Vec3.
number is a double.
See also:
setPoints(double number=1.0) adds new control point to the path and calls setPoints

osg::Vec3 Path::calculateCatmull (  osg::Vec3  first,
osg::Vec3  second,
osg::Vec3  third,
osg::Vec3  fourth,
double  fifth
) 
 

a normal member .

Parameters:
first is an osg::Vec3.
second is an osg::Vec3.
third is an osg::Vec3.
fourth is an osg::Vec3.
fifth is a double.
Returns:
osg::Vec3 Calculates the points on the cutmoll-rom curve,between the given four control points(A,B,C,D) returns the calculated point

void Path::deletePart (   ) 
 

a normal member . removes dotGroup and lineGroup from teh root.

osg::Node* Path::displayDots (  void   ) 
 

a normal member .

Returns:
pointer to osg::Node. displays(adds to the scene root) control points of the path

osg::Node* Path::displayLines (  void   ) 
 

a normal member .

Returns:
pointer to osg::Node. displays(adds to the scene root) lines of the path

void Path::draw (  osg::ref_ptr< osg::Group >  root,
int  animationFlag = -1
)  [virtual]
 

a normal member taking two arguments.

Parameters:
root is an osg::ref_ptr to osg::Group which the model node will be added.
animationFlag is an integer flag to specify whether the root is animation window root or not. this function adds the path geodes and groups to the root.

Implements TraffEduObject.

osg::Vec3* Path::getControlPointVector (   ) 
 

a normal member .

Returns:
osg::Vec3 pointer. returns ControlPoint vector of the path.

osg::Vec3* Path::getPointVector (   ) 
 

a normal member .

Returns:
osg::Vec3 pointer. returns point vector of the path.

double* Path::getRotationArray (   ) 
 

a normal member .

Returns:
osg::Vec3 pointer. returns rotation array of the path.

double Path::returnAngle (  osg::Vec3d  first,
osg::Vec3d  second
) 
 

a normal member .

Parameters:
first an osg::Vec3.
second an osg::Vec3.
Returns:
double Calculates the angle between two given points returns the calculated angle

void Path::setPoints (  double  number = 1.0  ) 
 

a normal member .

Parameters:
number a double. controlPoints: 0 1 2 3 controlPointsIndex:0 calculates the points between 1 and 2, adds to pointArray changes controlPointsIndex to 1

void Path::setRotationArray (   ) 
 

a normal member . calls returnAngle for each successive point of the path, and constructs rotation array.


Member Data Documentation

osg::Vec3 Path::controlPointArray[MAXCONTROLPOINTS] [private]
 

int Path::controlPointsIndex [private]
 

osg::Geode* Path::dotGeode [private]
 

osg::Geometry* Path::dotGeom [private]
 

osg::Group* Path::dotGroup [private]
 

osg::Geode* Path::lineGeode [private]
 

osg::Geometry* Path::lineGeom [private]
 

osg::Group* Path::lineGroup [private]
 

int Path::numControlPoints [private]
 

int Path::numPoints [private]
 

osg::Vec3 Path::pointArray[MAXPOINTS] [private]
 

double Path::rotationArray[MAXPOINTS] [private]
 

int Path::rotationArrayIndex [private]
 


The documentation for this class was generated from the following file:
Generated on Sun May 28 18:44:00 2006 by  doxygen 1.4.6-NO